package create.builder;

import create.builder.old.Director;
import create.builder.old.FiveBuilder;
import create.builder.old.House;

/**
 * @author dali
 * @date 2021-07-09 15:31
 * @Description
 */

public class Test {
    public static void main(String[] args) {
        //普通方式盖房子
        House house1 = new House();
        house1.setBase("普通房子的地基");
        house1.setWall("普通房子的墙");
        house1.setCell("普通房子的吊顶");
        System.out.println(house1);
        //流行方式
        create.builder.House house2 = new create.builder.House.Builder()
                .base("流行房子的地基")
                .wall("流行方式的墙")
                .cell("流行方式的顶子")
                .build();
        System.out.println(house2);
        //建造者模式盖房子
        Director director = new Director();
        House house = director.build(new FiveBuilder());
        System.out.println(house);
    }
}
